#!/bin/sh

uci -q batch <<-EOF >/dev/null
	delete firewall.softethervpn
	set firewall.softethervpn=include
	set firewall.softethervpn.type=script
	set firewall.softethervpn.path=/usr/share/softethervpn/firewall.include
	set firewall.softethervpn.reload=1
EOF

uci -q batch <<-EOF >/dev/null
	delete ucitrack.@softethervpn[-1]
	add ucitrack softethervpn
	set ucitrack.@softethervpn[-1].init=softethervpn
	commit ucitrack
EOF

/etc/init.d/softethervpnbridge disable && /etc/init.d/softethervpnbridge stop
/etc/init.d/softethervpnclient disable && /etc/init.d/softethervpnclient stop
/etc/init.d/softethervpnserver disable && /etc/init.d/softethervpnserver stop

chmod a+x /usr/share/softethervpn/* >/dev/null 2>&1

rm -f /tmp/luci-indexcache
exit 0
